package util;

import java.io.Serializable;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class JPAUtil implements Serializable {
    private static EntityManagerFactory emf; // Fábrica de Gerente de entidade
    
    static {
        emf = Persistence.createEntityManagerFactory("AutonomusPU");       
    }
    
    public static EntityManager getEntityManager(){ // Retorna um gerente de entidade
        return emf.createEntityManager();
    }
    
    
}
